package com.example.factory2;

/**
 * @version 1.0.0
 * @className: Factory
 * @description: 工厂类
 * @author: rosszhang
 * @date: 2022/5/13 11:06
 */
public class Factory {
    public static Car getCarInstance(int type) {
        Car car = null;
        if (type == 1) {
            car = new Benz();
        } else if (type == 2) {
            car = new Ford();
        }
        return car;
    }
}
